#ifndef SH367309_H
#define SH367309_H

#include <rtthread.h>
#include <rtdevice.h>

// I2C device name
#define SH367309_I2C_DEVICE_NAME "i2c1"  // 根据你的硬件配置修改I2C设备名称

// Register addresses
#define SH367309_REG_VOLTAGE_CELL_BASE   0x02
#define SH367309_REG_CURRENT             0x08
#define SH367309_REG_TEMPERATURE_BASE    0x0A


#define SH367309_NUM_CELLS               16
#define SH367309_NUM_TEMPERATURES        3

// Function declarations
void sh367309_init(void);
rt_err_t sh367309_read_voltage(rt_uint16_t *voltage, rt_uint8_t cell_index);
rt_err_t sh367309_read_all_voltages(rt_uint16_t voltages[SH367309_NUM_CELLS]);
rt_err_t sh367309_read_current(rt_int16_t *current);
rt_err_t sh367309_read_temperature(rt_uint16_t *temperature, rt_uint8_t temperature_index);

rt_err_t sh367309_read_all_temperatures(rt_uint16_t temperatures[SH367309_NUM_TEMPERATURES]);
#endif // SH367309_H
